home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9433 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: wkaufman.us.oracle.com!wkaufman
  2. From: wkaufman@wkaufman.us.oracle.com (William Kaufman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ?? How to dump text files to screen ??
  5. Date: 10 Mar 1996 17:42:50 GMT
  6. Organization: Oracle Corporation, Redwood Shores CA
  7. Message-ID: <4hv4aq$t0q@inet-nntp-gw-1.us.oracle.com>
  8. References: <31430CE8.469E@aol2.com>
  9. NNTP-Posting-Host: wkaufman.us.oracle.com
  10.  
  11. In article <31430CE8.469E@aol2.com> Neil <neil@aol2.com> writes:
  12. ] I need help -- how can I open up a text file and just dump it
  13. ] all out (in plain text) to the screen?
  14.  
  15.         #ifdef unix
  16.             system("cat file");
  17.         #else
  18.             system("type file");
  19.         #endif
  20.  
  21.     Note that this isn't completely portable,...
  22.  
  23.     (Or you fopen() the file and keep reading from the file and writing
  24. to stdout.)
  25.  
  26.                                            -- Bill K.
  27.  
  28. Bill Kaufman               | " While not a master of intellect, the blatantly
  29. wkaufman@us.oracle.com     |   obvious things we take for granted never
  30.                            |   escape his keen eye! "          -- Bob Burden
  31.